<template>
  <m-header></m-header>
  <top></top>
  <router-view :style="viewStyle"></router-view>
  <router-view
    v-slot="{ Component }"
    :style="viewStyle"
    name="user"
  >
    <transition appear name="slide">
      <component :is="Component"></component>
    </transition>
  </router-view>
  <player />
</template>

<script>
import Header from '@/components/header/header';
import Top from '@/components/tab/tab.vue';
import Player from '@/components/player/player';
import { mapState } from 'vuex';

export default {
  components: {
    MHeader: Header,
    top: Top,
    player: Player
  },
  computed: {
    ...mapState(['playList']),
    viewStyle() {
      const bottom = this.playList.length ? '60px' : 0;
      return {
        top: `${this.imageHeight}px`,
        bottom
      };
    }
  }
};
</script>

<style lang="scss">
</style>
